import { DataByPage, RESPONSE } from "../Types/Api/base"
import { IssueData, IssuePageData } from "../Types/Api/issue"
import { request } from "./base"

enum API {
  GET_ISSUE_BY_PAGE = "/api/issue/",
  // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
  GET_ISSUE_BY_ID = "/api/issue/",
}

// query a=1&b=2&c=3
export const reqGetIssueByPage = (data: IssuePageData) =>
  request.get<null, RESPONSE<DataByPage<IssueData>>>(API.GET_ISSUE_BY_PAGE, {
    params: data,
  })

export const reqGetIssueById = (id: string) =>
  request.get<null, RESPONSE<IssueData>>(API.GET_ISSUE_BY_ID + id)
